package com.imooc.coupon.dao;

import com.imooc.coupon.constant.CouponStatus;
import com.imooc.coupon.entity.Coupon;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @Date 2021/11/2 17:16
 * @Author wangshbv
 * @Description coupon dao 接口定义
 */
public interface CouponDao extends JpaRepository<Coupon, Integer> {
    /**
     * 根据userId和状态查询优惠卷
     * @author wangshbv
     * @date 17:18
     */
    List<Coupon> findAllByUserIdAndStatus(Long userId, CouponStatus status);


}
